[DX] Clean up .env.example: remove duplicates, add source comments, improve onboarding#212
[DX] Clean up .env.example: remove duplicates, add source comments, improve onboarding#212udaycodespace wants to merge 3 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR updates ChangesEnvironment Configuration Refresh
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.env.example:
- Line 58: Add a single trailing newline at the end of the .env.example file so
the file ends with a blank line (this fixes the dotenv-linter EndingBlankLine
warning); locate the RAZORPAY_WEBHOOK_SECRET line and ensure there is one
newline character after it (no extra characters or spaces).
- Around line 21-24: The ENCRYPTION_KEY guidance is inconsistent with how the
code decodes it (Buffer.from(..., 'hex') in
packages/common/src/utils/encryption.js); update the .env.example ENCRYPTION_KEY
line to instruct generating a hex string (e.g., use openssl rand -hex 32) and
specify the expected length (64 hex chars for a 32-byte key) so the env value
matches Buffer.from(..., 'hex') at runtime. Also briefly clarify that
JWT_SECRET/API_KEY_SALT can remain base64 if desired, but ENCRYPTION_KEY must be
hex.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
d3da05a to
2c868fb
Compare
|
i created secrets from crypy.randombytes(32).tostring('hex') |
|
Tip For best results, initiate chat on the files or code changes.
Since this project likely uses Node.js, it might be worth adding it as an inline alternative in the # Generate a random secret: openssl rand -base64 32
# Or with Node.js: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"That way, Windows users without |
Updated examples for JWT_SECRET and ENCRYPTION_KEY in .env.example.
|
@yash-pouranik Added the Node.js-based secret generation alternative alongside the openssl example as well, so contributors on Windows or without openssl can generate secrets more easily. |
PR Description
Summary
This PR cleans up
.env.exampleto improve first-time contributor onboarding by removing duplicate entries, adding concise source comments, and including cross-platform setup instructions.Changes
.env.example#207)opensslexamplecp .env.example .envCopy-Item .env.example .envWhy this matters
Testing
Closes #207
Summary by CodeRabbit